home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C++ für Kids
/
C++ for kids.iso
/
Buch
/
Rund1.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1998-12-27
|
1KB
|
47 lines
//---------------------------------------------------------------------------
#include <vcl\vcl.h>
#pragma hdrstop
#include "Rund1.h"
//---------------------------------------------------------------------------
#pragma resource "*.dfm"
int x, y, Dicke;
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Canvas->Ellipse (x, y, x+Dicke, y+Dicke);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
TRect Quelle, Ziel;
for (int i=x-5; i<ClientWidth-Dicke-x-5; i++)
{
Quelle = Rect(i, y-5, i+Dicke+5, y+Dicke+5);
Ziel = Rect(i+1, y-5, i+Dicke+6, y+Dicke+5);
Canvas->CopyRect(Ziel, Canvas, Quelle);
// Bremse, abhΣngig vom Prozessortakt!
for (int j=0; j<1000000; j++) ;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button3Click(TObject *Sender)
{
Refresh ();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
x = 30;
y = 30;
Dicke = 150;
}
//---------------------------------------------------------------------------